package com.xiaomage.view.draw6

import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.util.Log
import android.widget.LinearLayout
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        val myView=MyView(this)
        val params=LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.WRAP_CONTENT,
                500
        )
        myView.layoutParams=params
        ll_zong.addView(myView)

        val myView4=MyView4(this)
        val params4=LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.WRAP_CONTENT,
                500
        )
        myView4.layoutParams=params4
        myView4.setOnClickListener{
            Log.e("点击了","点解le")
            myView4.startAnimation()
        }
        ll_zong.addView(myView4)


        bt_two.setOnClickListener{
            intent=Intent(this,Main2Activity::class.java)
            startActivity(intent)
        }
        bt_three.setOnClickListener{
            intent=Intent(this,Main3Activity::class.java)
            startActivity(intent)
        }


    }
}
